import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

var router = new Router({
    mode: 'history',
    routes: [
        {
            path: '/',
            name: 'index',
            component: () => import('@/pages/index/index.vue'),
            meta: {
                title: '首页',
                show: true
            }
        },
        {
            path: '/graduate',
            name: 'Graduate',
            component: () => import('@/pages/graduate/graduate.vue'),
            meta: {
                title: '校友',
                show: true
            }
        },
        {
            path: '/graduate/details',
            name: 'GraduateDetails',
            component: () => import('@/pages/graduate/details.vue'),
            meta: {
                title: '校友详情',
                show: true
            }
        },
        {
            path: '/message',
            name: 'Message',
            component: () => import('@/pages/message/message.vue'),
            meta: {
                title: '我的消息',
                show: true
            }
        },
        {
            path: '/news/detail',
            name: 'NewsDetail',
            component: () => import('@/pages/news/detail.vue'),
            meta: {
                title: '新闻详情',
                show: true
            }
        },
        {
            path: '/activity',
            name: 'Activity',
            component: () => import('@/pages/activity/activity.vue'),
            meta: {
                title: '活动列表',
                show: true
            }
        },
        {
            path: '/activity/details',
            name: 'ActivityDetails',
            component: () => import('@/pages/activity/details.vue'),
            meta: {
                title: '活动详情',
                show: true
            }
        },
        {
            path: '/activity/create',
            name: 'ActivityCreate',
            component: () => import('@/pages/activity/create.vue'),
            meta: {
                title: '发起活动',
                show: true
            }
        },
        {
            path: '/mine',
            name: 'Mine',
            component: () => import('@/pages/mine/mine.vue'),
            meta: {
                title: '我的',
                show: true
            }
        },
        {
            path: '/mine/activity',
            name: 'MineActivity',
            component: () => import('@/pages/mine/mineActivity.vue'),
            meta: {
                title: '我参与的活动',
                show: true
            }
        },
        {
            path: '/mine/mutual',
            name: 'MineMutual',
            component: () => import('@/pages/mine/mineMutual.vue'),
            meta: {
                title: '我参与的合作',
                show: true
            }
        },
        {
            path: '/mutual',
            name: 'Mutual',
            component: () => import('@/pages/mutual/mutual.vue'),
            meta: {
                title: '合作共赢',
                show: true
            }
        },
        {
            path: '/mutual/details',
            name: 'MutualDetails',
            component: () => import('@/pages/mutual/details.vue'),
            meta: {
                title: '合作详情',
                show: true
            }
        },
        {
            path: '/mutual/create',
            name: 'MutualCreate',
            component: () => import('@/pages/mutual/create.vue'),
            meta: {
                title: '合作详情',
                show: true
            }
        },
        {
            path: '/notice_index',
            name: 'Notice_index',
            component: () => import('@/pages/notice/index.vue'),
            meta: {
                title: '公告头条',
                show: true
            }
        },
        {
            path: '/notice_detail',
            name: 'Notice_detail',
            component: () => import('@/pages/notice/detail.vue'),
            meta: {
                title: '公告头条详情',
                show: true
            }
        },
        // 扫码签到
        {
            path: '/sign_in_select',
            name: 'sign_in_select',
            component: () => import('@/pages/signIn/sign_in_select.vue'),
            meta: {
                title: '扫码签到',
                show: true
            }
        },
        {
            path: '/sign_in_index',
            name: 'sign_in_index',
            component: () => import('@/pages/signIn/index.vue'),
            meta: {
                title: '扫码签到',
                show: true
            }
        },
        {
            path: '/sign_in_write',
            name: 'sign_in_write',
            component: () => import('@/pages/signIn/sign_in_write.vue'),
            meta: {
                title: '扫码签到',
                show: true
            }
        },


        //
        {
            path: '/login',
            name: 'Login',
            component: () => import('@/pages/login/login.vue'),
            meta: {
                title: '登录',
                show: true
            }
        },
        {
            path: '/register',
            name: 'Register',
            component: () => import('@/pages/login/register.vue'),
            meta: {
                title: '注册',
                show: true
            }
        },
        {
            path: '/forgetpwd',
            name: 'Forgetpwd',
            component: () => import('@/pages/login/forgetpwd.vue'),
            meta: {
                title: '忘记密码',
                show: true
            }
        },
        {
            path: '/forgetpwdnext',
            name: 'Forgetpwdnext',
            component: () => import('@/pages/login/forgetpwdnext.vue'),
            meta: {
                title: '忘记密码',
                show: true
            }
        },
        {
            path: '/changepwd',
            name: 'Changepwd',
            component: () => import('@/pages/login/changepwd.vue'),
            meta: {
                title: '修改密码',
                show: true
            }
        },
        {
            path: '/changepwdnext',
            name: 'Changepwdnext',
            component: () => import('@/pages/login/changepwdnext.vue'),
            meta: {
                title: '修改密码',
                show: true
            }
        },
        {
            path: '/changephone',
            name: 'Changephone',
            component: () => import('@/pages/login/changephone.vue'),
            meta: {
                title: '修改手机号'
            }
        },
        {
            path: '/changephonenext',
            name: 'Changephonenext',
            component: () => import('@/pages/login/changephonenext.vue'),
            meta: {
                title: '修改手机号'
            }
        },
        {
            path: '/my_patient',
            name: 'my_patient',
            component: () => import('@/pages/patient/my_patient.vue'),
            meta: {
                title: '我的就诊人'
            }
        },
        {
            path: '/switch_patient',
            name: 'switch_patient',
            component: () => import('@/pages/patient/switch_patient.vue'),
            meta: {
                title: '切换就诊人'
            }
        },
        {
            path: '/my_patient/add_patient',
            name: 'add_patient',
            component: () => import('@/pages/patient/add_patient.vue'),
            meta: {
                title: '添加就诊人'
            }
        },
        {
            path: '/registration_record',
            name: 'registration_record',
            component: () => import('@/pages/registration/registration_record.vue'),
            meta: {
                title: '挂号记录'
            }
        },
        {
            path: '/registration_record_unpaid',
            name: 'registration_record_unpaid',
            component: () => import('@/pages/registration/registration_record_unpaid.vue'),
            meta: {
                title: '挂号记录'
            }
        },
        {
            path: '/registration_record_appo',
            name: 'registration_record_appo',
            component: () => import('@/pages/registration/registration_record_appo.vue'),
            meta: {
                title: '挂号记录'
            }
        },
        {
            path: '/registration_record_take',
            name: 'registration_record_take',
            component: () => import('@/pages/registration/registration_record_take.vue'),
            meta: {
                title: '挂号记录'
            }
        },
        {
            path: '/registration_record_cancel',
            name: 'registration_record_cancel',
            component: () => import('@/pages/registration/registration_record_cancel.vue'),
            meta: {
                title: '挂号记录'
            }
        },

        {
            path: '/appointment',
            name: 'appointment',
            component: () => import('@/pages/registration/appointment.vue'),
            meta: {
                title: '预约挂号'
            }
        },
        {
            path: '/appointment_next',
            name: 'appointment_next',
            component: () => import('@/pages/registration/appointment_next.vue'),
            meta: {
                title: '预约挂号'
            }
        },
        {
            path: '/registration_agreement',
            name: 'registration_agreement',
            component: () => import('@/pages/registration/registration_agreement.vue'),
            meta: {
                title: '挂号协议'
            }
        },

        {
            path: '/department_introduced',
            name: 'department_introduced',
            component: () => import('@/pages/department_introduced/index.vue'),
            meta: {
                title: '科室介绍',
                show: true
            }
        },
        {
            path: '/department_details',
            name: 'department_details',
            component: () => import('@/pages/department_introduced/details.vue'),
            meta: {
                title: '科室简介'
            }
        },

        {
            path: '/doctor_list',
            name: 'doctor_list',
            component: () => import('@/pages/doctor/doctor_list.vue'),
            meta: {
                title: '医生介绍',
                show: true
            }
        },
        {
            path: '/doctor_details',
            name: 'doctor_details',
            component: () => import('@/pages/doctor/doctor_details.vue'),
            meta: {
                title: '医生简介'
            }
        },
        {
            path: '/doctor_search',
            name: 'doctor_search',
            component: () => import('@/pages/doctor/doctor_search.vue'),
            meta: {
                title: '搜索'
            }
        },
        {
            path: '/confirm_appointment',
            name: 'confirm_appointment',
            component: () => import('@/pages/registration/confirm_appointment.vue'),
            meta: {
                title: '确认预约'
            }
        },
        // 智能导诊
        {
            path: '/smart_leading_examining',
            name: 'smart_leading_examining',
            component: () => import('@/pages/smart_leading_examining/index.vue'),
            meta: {
                title: '智能导诊',
                show: true
            }
        },
        {
            path: '/smart_leading_examining_search',
            name: 'smart_leading_examining_search',
            component: () => import('@/pages/smart_leading_examining/search.vue'),
            meta: {
                title: '智能导诊',
                show: true
            }
        },
        // 住院记录
        {
            path: '/hospital_records',
            name: 'hospital_records',
            component: () => import('@/pages/hospital_records/index.vue'),
            meta: {
                title: '住院记录'
            }
        },
        {
            path: '/hospital_records_detail',
            name: 'hospital_records_detail',
            component: () => import('@/pages/hospital_records/detail.vue'),
            meta: {
                title: '住院记录详情'
            }
        },
        {
            path: '/hos_day_list',
            name: 'hos_day_list',
            component: () => import('@/pages/hospital_records/hos_day_list.vue'),
            meta: {
                title: '住院日清单'
            }
        },
        {
            path: '/accepting_gold_list',
            name: 'accepting_gold_list',
            component: () => import('@/pages/hospital_records/accepting_gold_list.vue'),
            meta: {
                title: '预交金查询'
            }
        },
        {
            path: '/accepting_gold_detail',
            name: 'accepting_gold_detail',
            component: () => import('@/pages/hospital_records/accepting_gold_detail.vue'),
            meta: {
                title: '预交金明细'
            }
        },
        {
            path: '/little_message',
            name: 'little_message',
            component: () => import('@/pages/message/little_message.vue'),
            meta: {
                title: '健康资讯',
                show: true
            }
        },
        {
            path: '/message_details',
            name: 'message_details',
            component: () => import('@/pages/message/details.vue'),
            meta: {
                title: '健康资讯',
                show: true
            }
        },
        {
            path: '/inspection',
            name: 'inspection',
            component: () => import('@/pages/inspection/index.vue'),
            meta: {
                title: '检查检验报告'
            }
        },
        {
            path: '/inspection_report',
            name: 'inspection_report',
            component: () => import('@/pages/inspection/inspection_report.vue'),
            meta: {
                title: '检查报告'
            }
        },
        {
            path: '/survey_report',
            name: 'survey_report',
            component: () => import('@/pages/inspection/survey_report.vue'),
            meta: {
                title: '检验报告'
            }
        },
        {
            path: '/baogao',
            name: 'baogao',
            component: () => import('@/pages/inspection/baogao.vue'),
            meta: {
                title: '报告影像图'
            }
        },
        {
            path: '/waiting_line',
            name: 'waiting_line',
            component: () => import('@/pages/waiting_line/index.vue'),
            meta: {
                title: '候诊排队'
            }
        },
        {
            path: '/waiting_line_detail',
            name: 'waiting_line_detail',
            component: () => import('@/pages/waiting_line/detail.vue'),
            meta: {
                title: '排队详情'
            }
        },
        // 门诊缴费
        {
            path: '/outpatient_payment',
            name: 'outpatient_payment',
            component: () => import('@/pages/outpatient_payment/index.vue'),
            meta: {
                title: '门诊缴费'
            }
        },
        {
            path: '/outpatient_payment_list',
            name: 'outpatient_payment_list',
            component: () => import('@/pages/outpatient_payment/list.vue'),
            meta: {
                title: '门诊缴费'
            }
        },
        {
            path: '/outpatient_payment_lost',
            name: 'outpatient_payment_lost',
            component: () => import('@/pages/outpatient_payment/lost.vue'),
            meta: {
                title: '缴费订单'
            }
        },
        {
            path: '/outpatient_payment_paid',
            name: 'outpatient_payment_paid',
            component: () => import('@/pages/outpatient_payment/paid.vue'),
            meta: {
                title: '缴费订单'
            }
        },
        {
            path: '/outpatient_payment_unpaid',
            name: 'Outpatient_payment_unpaid',
            component: () => import('@/pages/outpatient_payment/unpaid.vue'),
            meta: {
                title: '缴费订单'
            }
        },
        // 门诊记录
        {
            path: '/outpatient_records',
            name: 'outpatient_records',
            component: () => import('@/pages/outpatient_records/index.vue'),
            meta: {
                title: '门诊记录'
            }
        },
        {
            path: '/outpatient_records_detail',
            name: 'outpatient_records_detail',
            component: () => import('@/pages/outpatient_records/detail.vue'),
            meta: {
                title: '病历详情'
            }
        },
        // 住院预交金
        {
            path: '/outpatient_payment_unpaid',
            name: 'outpatient_payment_unpaid',
            component: () => import('@/pages/outpatient_payment/unpaid.vue'),
            meta: {
                title: '缴费订单'
            }
        },

        // 病历复印模块

        // 病历复印记录
        {
            path: '/medical_record_copy_list',
            name: 'Medical_record_copy_list',
            component: () => import('@/pages/MedicalRecordCopy/MedicalRecordCopyList.vue'),
            meta: {
                keepAlive: false,
                title: "病历复印记录"
            }
        },
        {
            path: '/medical_record_copy_details',
            name: 'Medical_record_copy_details',
            component: () => import('@/pages/MedicalRecordCopy/MedicalRecordCopyDetails.vue'),
            meta: {
                keepAlive: false,
                title: "病历复印详情"
            }
        },
        // 病历复印步骤
        // 1
        {
            path: '/for_applicants',
            name: 'For_applicants',
            component: () => import('@/pages/MedicalRecordCopy/ForApplicants.vue'),
            meta: {
                keepAlive: false,
                title: "申请须知"
            }
        },
        // 2
        {
            path: '/copy_method',
            name: 'Copy_method',
            component: () => import('@/pages/MedicalRecordCopy/CopyMethod.vue'),
            meta: {
                keepAlive: false,
                title: "办理方式"
            }
        },
        // 3
        {
            path: '/upload_documents',
            name: 'Upload_documents',
            component: () => import('@/pages/MedicalRecordCopy/UploadDocuments.vue'),
            meta: {
                keepAlive: false,
                title: "上传证件"
            }
        },
        // 4
        {
            path: '/select_records',
            name: 'Select_records',
            component: () => import('@/pages/MedicalRecordCopy/SelectRecords.vue'),
            meta: {
                keepAlive: false,
                title: "选择病历"
            }
        },
        // 5
        {
            path: '/copy_utility',
            name: 'Copy_utility',
            component: () => import('@/pages/MedicalRecordCopy/CopyUtility.vue'),
            meta: {
                keepAlive: false,
                title: "填写信息"
            }
        },
        // 6
        {
            path: '/acknowledgment_message',
            name: 'Acknowledgment_message',
            component: () => import('@/pages/MedicalRecordCopy/AcknowledgmentMessage.vue'),
            meta: {
                keepAlive: false,
                title: "确认信息"
            }
        },

        // 诊后/出院注意事项
        {
            path: '/notes_list',
            name: 'Notes_list',
            component: () => import('@/pages/notes/index.vue'),
            meta: {
                keepAlive: false,
                title: "诊后注意事项",
                show: true
            }
        },
        {
            path: '/notes_detail',
            name: 'Notes_detail',
            component: () => import('@/pages/notes/detail.vue'),
            meta: {
                keepAlive: false,
                title: "诊后注意事项",
                show: true
            }
        },
        {
            path: '/notes_dept',
            name: 'Notes_dept',
            component: () => import('@/pages/notes/deptList.vue'),
            meta: {
                keepAlive: false,
                title: "出院注意事项",
                show: true
            }
        },

        // 医院信息


        {
            path: '/hosp_navigation',
            name: 'hosp_navigation',
            component: () => import('@/pages/hospital_information/navigation.vue'),
            meta: {
                title: '总医院',
                show: true
            }
        },

        {
            path: '/floor_distribution',
            name: 'floor_distribution',
            component: () => import('@/pages/hospital_information/floor_distribution.vue'),
            meta: {
                title: '总院-楼层分布',
                show: true
            }
        },
        {
            path: '/floor_search',
            name: 'floor_search',
            component: () => import('@/pages/hospital_information/floor_search.vue'),
            meta: {
                title: '搜索',
                show: true
            }
        },
        {
            path: '/navigation_map',
            name: 'navigation_map',
            component: () => import('@/pages/hospital_information/navigation_map.vue'),
            meta: {
                title: '第一院区导航',
                show: true
            }
        },

        {
            path: '/hosp_navigation_detail1',
            name: 'hosp_navigation_detail1',
            component: () => import('@/pages/hospital_information/navigation_detail1.vue'),
            meta: {
                title: '总医院',
                show: true
            }
        },
        {
            path: '/hosp_navigation_detail2',
            name: 'hosp_navigation_detail2',
            component: () => import('@/pages/hospital_information/navigation_detail2.vue'),
            meta: {
                title: '第一门诊-楼层分布',
                show: true
            }
        },
        {
            path: '/hosp_introduction',
            name: 'hosp_introduction',
            component: () => import('@/pages/hospital_information/introduction.vue'),
            meta: {
                title: '医院简介',
                show: true
            }
        },

        {
            path: '/privacy_agreement',
            name: 'privacy_agreement',
            component: () => import('@/pages/hospital_information/privacy_agreement.vue'),
            meta: {
                title: '隐私协议',
                show: true
            }
        },
        {
            path: '/user_policy',
            name: 'user_policy',
            component: () => import('@/pages/hospital_information/user_policy.vue'),
            meta: {
                title: '用户政策',
                show: true
            }
        },
        {
            path: '/feedback',
            name: 'feedback',
            component: () => import('@/pages/feedback/index.vue'),
            meta: {
                title: '意见反馈',
                noAuth: true
            }
        },
        {
            path: '/campus_choice',
            name: 'campus_choice',
            component: () => import('@/pages/campusChoice/index.vue'),
            meta: {
                title: '院区',
                show: true
            }
        },
        {
            path: '/illness_check',
            name: 'illness_check',
            component: () => import('@/pages/illnessCheck/index.vue'),
            meta: {
                title: '专病速查',
                show: true
            }
        },
        {
            path: '/reserv_service',
            name: 'reserv_service',
            component: () => import('@/pages/reservService/index.vue'),
            meta: {
                title: '专病速查详情',
                show: true
            }
        },
        {
            path: '/campus_choice_nav',
            name: 'campus_choice_nav',
            component: () => import('@/pages/hospital_information/campus_choice_nav.vue'),
            meta: {
                title: '医院导航-院区选择',
                show: true
            }
        },
        // 使用指南 operating_guide
        {
            path: '/operating_guide',
            name: 'operating_guide',
            component: () => import('@/pages/OperatingGuide/index.vue'),
            meta: {
                title: '使用指南',
                show: true
            }
        },
        // 电子发票
        {
            path: '/invoice_index',
            name: 'invoice_index',
            component: () => import('@/pages/invoice/index.vue'),
            meta: {
                title: '电子发票'
            }
        },
        {
            path: '/invoice_list',
            name: 'invoice_list',
            component: () => import('@/pages/invoice/list.vue'),
            meta: {
                title: '发票列表'
            }
        },
        {
            path: '/park_token',
            name: 'park_token',
            component: () => import('@/pages/park/park_token.vue'),
            meta: {
                title: '停车通行证'
            }
        }
    ],
    scrollBehavior(to, from, savedPosition) {
        return { x: 0, y: 0 }
    },
})
router.beforeEach((to, from, next) => {
    /* 路由发生变化修改页面title */
    if (to.meta.title) {
        document.title = to.meta.title;
    }
    next();
})
export default router



